Component({
    options: {
        styleIsolation: "shared"
    },
    properties: {
        takeGoodsShow: {
            type: Boolean,
            value: !1
        },
        manage_goods: {
            type: null,
            value: {}
        },
        name: {
            type: String,
            value: ""
        }
    },
    data: {
        chooseRadio: 1,
        numValue: 1
    },
    lifetimes: {
        attached: function() {}
    },
    observers: {
        takeGoodsShow: function(o) {
            o && this.setData({
                chooseRadio: this.data.manage_goods.original.show ? 1 : this.data.manage_goods.product.show ? 2 : ""
            });
        }
    },
    methods: {
        onChange: function(o) {
            this.setData({
                chooseRadio: o.detail
            });
        },
        closePopup: function() {
            this.setData({
                takeGoodsShow: !1
            });
        },
        delivery: function() {
            var o = {
                goodsId: 1 == this.data.chooseRadio ? this.data.manage_goods.original.goods_id : this.data.manage_goods.product.goods_id,
                total: this.data.numValue,
                stock_token: this.data.manage_goods.stock_token,
                take_type: this.data.chooseRadio,
                tag: "stock_service",
                take_way: "代销管理" == this.data.name ? 2 : "我的存货" == this.data.name ? 1 : "",
                option_id: 1 == this.data.chooseRadio ? this.data.manage_goods.original.option_id : this.data.manage_goods.product.option_id
            };
            wx.navigateTo({
                url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=stock_service&total=".concat(o.total, "&take_way=").concat(o.take_way, "&take_type=").concat(o.take_type, "&stock_token=").concat(o.stock_token, "&goodsId=").concat(o.goodsId, "&option_id=").concat(o.option_id)
            }), this.setData({
                takeGoodsShow: !1
            });
        },
        onChangeStepper: function(o) {
            this.setData({
                numValue: o.detail
            });
        }
    }
});